# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  #Changed in Rails 
  #No longer need to load the session
  #session :session_key => '_autograder_session_id'
  
  # Filters added to this controller will be run for all controllers in the
  # application.
  # Likewise, all the methods added will be available for all controllers.
  def authenticate
    if session['team'].nil?
      session['initial_uri'] = request.request_uri
      redirect_to :controller => "team", :action => "login" 
    end
  end
end
